package com.xiyang.cjtool;

import com.xiyang.cjtool.controller.MainController;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.fxml.JavaFXBuilderFactory;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

/**
 * javaFX的程序必须要继承{@link javafx.application.Application}
 * @author xiyang.ycj
 * @since Sep 01, 2020 15:37:39 PM
 */
public class App extends Application {
    @Override
    public void start(Stage primaryStage) throws Exception {
        FXMLLoader loader = new FXMLLoader();
        // 加载fxml
        loader.setLocation(getClass().getResource("/main.fxml"));
        loader.setBuilderFactory(new JavaFXBuilderFactory());
        Parent root = loader.load();

        // 为舞台设置场景大小
        Scene scene = new Scene(root, 640, 480);


    }

    public static void show(Stage primaryStage){

        MainController mainController = new MainController();

//        stage.setScene(scene);
        // 显示
        primaryStage.show();
    }
}
